/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Core.impl;

import EA_Model.IEC61970.Core.CorePackage;
import EA_Model.IEC61970.Core.IdentifiedObject;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Identified Object</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getAliasName <em>Alias Name</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getLocalName <em>Local Name</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getMRID <em>MRID</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getName <em>Name</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl#getPathName <em>Path Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class IdentifiedObjectImpl extends EObjectImpl implements IdentifiedObject {
	/**
	 * The cached value of the '{@link #getAliasName() <em>Alias Name</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAliasName()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String aliasName;

	/**
	 * The cached value of the '{@link #getDescription() <em>Description</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String description;

	/**
	 * The cached value of the '{@link #getLocalName() <em>Local Name</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLocalName()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String localName;

	/**
	 * The cached value of the '{@link #getMRID() <em>MRID</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMRID()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String mRID;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String name;

	/**
	 * The cached value of the '{@link #getPathName() <em>Path Name</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPathName()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String pathName;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected IdentifiedObjectImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CorePackage.Literals.IDENTIFIED_OBJECT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getAliasName() {
		if (aliasName != null && aliasName.eIsProxy()) {
			InternalEObject oldAliasName = (InternalEObject)aliasName;
			aliasName = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldAliasName);
			if (aliasName != oldAliasName) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME, oldAliasName, aliasName));
			}
		}
		return aliasName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetAliasName() {
		return aliasName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAliasName(EA_Model.IEC61970.Domain.String newAliasName) {
		EA_Model.IEC61970.Domain.String oldAliasName = aliasName;
		aliasName = newAliasName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME, oldAliasName, aliasName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getDescription() {
		if (description != null && description.eIsProxy()) {
			InternalEObject oldDescription = (InternalEObject)description;
			description = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldDescription);
			if (description != oldDescription) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__DESCRIPTION, oldDescription, description));
			}
		}
		return description;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetDescription() {
		return description;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDescription(EA_Model.IEC61970.Domain.String newDescription) {
		EA_Model.IEC61970.Domain.String oldDescription = description;
		description = newDescription;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__DESCRIPTION, oldDescription, description));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getLocalName() {
		if (localName != null && localName.eIsProxy()) {
			InternalEObject oldLocalName = (InternalEObject)localName;
			localName = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldLocalName);
			if (localName != oldLocalName) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME, oldLocalName, localName));
			}
		}
		return localName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetLocalName() {
		return localName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLocalName(EA_Model.IEC61970.Domain.String newLocalName) {
		EA_Model.IEC61970.Domain.String oldLocalName = localName;
		localName = newLocalName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME, oldLocalName, localName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getMRID() {
		if (mRID != null && mRID.eIsProxy()) {
			InternalEObject oldMRID = (InternalEObject)mRID;
			mRID = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldMRID);
			if (mRID != oldMRID) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__MRID, oldMRID, mRID));
			}
		}
		return mRID;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetMRID() {
		return mRID;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMRID(EA_Model.IEC61970.Domain.String newMRID) {
		EA_Model.IEC61970.Domain.String oldMRID = mRID;
		mRID = newMRID;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__MRID, oldMRID, mRID));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getName() {
		if (name != null && name.eIsProxy()) {
			InternalEObject oldName = (InternalEObject)name;
			name = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldName);
			if (name != oldName) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__NAME, oldName, name));
			}
		}
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(EA_Model.IEC61970.Domain.String newName) {
		EA_Model.IEC61970.Domain.String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getPathName() {
		if (pathName != null && pathName.eIsProxy()) {
			InternalEObject oldPathName = (InternalEObject)pathName;
			pathName = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldPathName);
			if (pathName != oldPathName) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.IDENTIFIED_OBJECT__PATH_NAME, oldPathName, pathName));
			}
		}
		return pathName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetPathName() {
		return pathName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPathName(EA_Model.IEC61970.Domain.String newPathName) {
		EA_Model.IEC61970.Domain.String oldPathName = pathName;
		pathName = newPathName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.IDENTIFIED_OBJECT__PATH_NAME, oldPathName, pathName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME:
				if (resolve) return getAliasName();
				return basicGetAliasName();
			case CorePackage.IDENTIFIED_OBJECT__DESCRIPTION:
				if (resolve) return getDescription();
				return basicGetDescription();
			case CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME:
				if (resolve) return getLocalName();
				return basicGetLocalName();
			case CorePackage.IDENTIFIED_OBJECT__MRID:
				if (resolve) return getMRID();
				return basicGetMRID();
			case CorePackage.IDENTIFIED_OBJECT__NAME:
				if (resolve) return getName();
				return basicGetName();
			case CorePackage.IDENTIFIED_OBJECT__PATH_NAME:
				if (resolve) return getPathName();
				return basicGetPathName();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME:
				setAliasName((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case CorePackage.IDENTIFIED_OBJECT__DESCRIPTION:
				setDescription((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME:
				setLocalName((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case CorePackage.IDENTIFIED_OBJECT__MRID:
				setMRID((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case CorePackage.IDENTIFIED_OBJECT__NAME:
				setName((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case CorePackage.IDENTIFIED_OBJECT__PATH_NAME:
				setPathName((EA_Model.IEC61970.Domain.String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME:
				setAliasName((EA_Model.IEC61970.Domain.String)null);
				return;
			case CorePackage.IDENTIFIED_OBJECT__DESCRIPTION:
				setDescription((EA_Model.IEC61970.Domain.String)null);
				return;
			case CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME:
				setLocalName((EA_Model.IEC61970.Domain.String)null);
				return;
			case CorePackage.IDENTIFIED_OBJECT__MRID:
				setMRID((EA_Model.IEC61970.Domain.String)null);
				return;
			case CorePackage.IDENTIFIED_OBJECT__NAME:
				setName((EA_Model.IEC61970.Domain.String)null);
				return;
			case CorePackage.IDENTIFIED_OBJECT__PATH_NAME:
				setPathName((EA_Model.IEC61970.Domain.String)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CorePackage.IDENTIFIED_OBJECT__ALIAS_NAME:
				return aliasName != null;
			case CorePackage.IDENTIFIED_OBJECT__DESCRIPTION:
				return description != null;
			case CorePackage.IDENTIFIED_OBJECT__LOCAL_NAME:
				return localName != null;
			case CorePackage.IDENTIFIED_OBJECT__MRID:
				return mRID != null;
			case CorePackage.IDENTIFIED_OBJECT__NAME:
				return name != null;
			case CorePackage.IDENTIFIED_OBJECT__PATH_NAME:
				return pathName != null;
		}
		return super.eIsSet(featureID);
	}

} //IdentifiedObjectImpl
